#include <stdio.h>
int main()
{
	int year = 0, month = 0, day = 0;
	scanf("%d-%d-%d", &year, &month, &day);
	char weekday[7][10] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
	int num = 0;
	for (int i = 1980; i < year; i++)
	{
		num += (i % 4 == 0 && (i % 100 != 0 || i % 400 == 0)) ? 366 : 365;
	}
	int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
	if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
	{
		days[1] = 29;
	}
	for (int j = 0; j < month - 1; j++)
	{
		num += days[j];
	}
	num += day - 1;
	printf("%s\n", weekday[(num + 1) % 7]);
	return 0;
}
